<?php
include APPPATH."views/frontend/inc/01_meta.php";
include APPPATH."views/frontend/inc/02_head.php";
include APPPATH."views/frontend/inc/04_slider.php";
?>
<div class="navi">
	<a href="/home">Trang chủ</a>
	<div class="clear"></div>
	<?php include APPPATH."views/frontend/inc/05_social.php"; ?>
</div>

<div class="container">
	<div class="-row lookcakes" style="">
		<div class="col-sxs-4">
			<div class="lookcake">
				<img class="cake-icon" src="/images/icon1.png" title="icon-name" />
				<h1 class="cake-title">Giới thiệu</h1>
				<div class="cake-text">
				Chúng tôi luôn tự hào<br />
				“SỨC KHỎE, NIỀM VUI CỦA KHÁCH HÀNG LÀ NIỀM TỰ HÀO CỦA CHÚNG TÔI ”.
				</div>
				<div style="padding:15px 0">
					<a href="/gioi-thieu" class="btn btn-default">XEM THÊM</a>
				</div>
				<div class="clear"></div>
			</div>
			
		</div>
		<div class="col-sxs-4">
			<div class="lookcake">
				<img class="cake-icon" src="/images/icon2.png" title="icon-name" />
				<h1 class="cake-title">Dịch vụ</h1>
				<div class="cake-text">
				DẬY LÀM BÁNH TẠI NHÀ<br />
				GIAO HÀNG TẬN NƠI TẠI TP HCM<br />
				NHẬN ĐẶT BÁNH THEO YÊU CẦU
				</div>
				<div style="padding:15px 0">
					<a href="/gioi-thieu" class="btn btn-default">XEM THÊM</a>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="col-sxs-4">
			<div class="lookcake">
				<img class="cake-icon" src="/images/icon3.png" title="icon-name" />
				<h1 class="cake-title">Mua bán</h1>
				<div class="cake-text">
				CHUYÊN CUNG CẤP NGUYÊN LIỆU<br />
				DỤNG CỤ LÀM BÁNH CAO CẤP VÀ NGOẠI NHẬP<br /> 
				GIAO HÀNG TẬN NƠI
				</div>
				<div style="padding:15px 0">
					<a href="/mua-ban" class="btn btn-default">XEM THÊM</a>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="-row lookcakes">
		<div class="col-sm-4">
			<div class="cake-news">
				<h3><?php echo $about_info->Title?></h3>
				<div class="cake-text">
					<?php echo $about_info->Desc?>
				</div>
				<div class="small-content">
					<?php echo $about_info->Content?>	
				</div>
				<div style="padding:15px 0">
					<a href="/tin-tuc/<?php echo $about_info->Id?>-<?php echo $about_info->Alias?>" class="btn btn-default">XEM THÊM</a>
				</div>
			</div>
		</div>
		<div class="col-sm-4">
			<div class="cake-news">
				<h3>SẢN PHẨM MỚI</h3>
				<div class="cake-text">
					Sản phẩm nổi bật được đặt hàng nhiều
				</div>
			</div>
			<div class="row-" style="margin-left:-4px;margin-right:-4px;">
				
				<div id="owl-demo" class="owl-carousel">
				<?php 
				//foreach($products as $cake){ 
				for($i=0;$i<count($products);$i+=6){ 
					?>
					<div class="item">
					<?php
					for($j=0;$j<6;$j++){
						$cake= $products[$i+$j];
						$thumb = $cake->product_thumb;
						$thumb = preg_replace('/\/data/','',$thumb,1);
						if(file_exists(APPPATH. "../data/thumbs/$thumb") && is_file(APPPATH. "../data/thumbs/$thumb")){
							$cake->small_thumb = "/data/thumbs$thumb";
						}else{
						$cake->small_thumb = $cake->product_thumb;
						}
					?>
					<div class="col-lg-6 col-sxs-6 col-sm-12">
						<div class="cake-item flip-container row" style="padding:4px">
							<a class="swipebox" 
								title="<?php echo $cake->product_title?>" 
								href="<?php echo $cake->product_thumb?>">
								<div class="nailthumb" data-rel="imageGallery">
									<div class="nailthumb-figure"
										data-title="<?php echo $cake->product_title?>" 
										data-src="<?php echo $cake->product_thumb?>"
										>
										<div class="nailthumb-container">
											<div class="front">
												<img class="flu lazyOwl" data-original="<?php echo $cake->small_thumb?>"
													alt="<?php echo $cake->product_title?>"
													title="<?php echo $cake->Title?>"
													/>
											</div>
											<div class="back">
												<img class="flu wp-image-55 lazyOwl" data-original="<?php echo $cake->small_thumb?>"
													alt="<?php echo $cake->product_title?>"
													title="<?php echo $cake->product_title?>"
													/>
											</div>
										</div>
										<!--<div class="nailthumb-mark"></div>-->
									</div>
								</div>
							</a>
							<div>
								<div class="cake-title"><?php echo $cake->product_title?></div>
							</div>
						</div>
					</div>
				<?php 
					}
					?>
						<div class="clear"></div>
					</div>
					<?php
				} 
				?>
				</div>
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
			<link rel="stylesheet" href="/libraries/carousel/owl.carousel.css">
			<!-- Default Theme -->
			<link rel="stylesheet" href="/libraries/carousel/owl.theme.css">
			<script src="/libraries/carousel/owl.carousel.js"></script>
			<script>
				$(document).ready(function() {
 
				  $("#owl-demo").owlCarousel({
					autoPlay : false,
					stopOnHover : true,
					navigation:false,
					pagination:false,
					paginationSpeed : 1000,
					goToFirstSpeed : 2000,
					singleItem : true,
					autoHeight : true,
					beforeInit:function(){
						$("img.lazyOwl").lazyload();
					},
					beforeMove:function(){
						$("img.lazyOwl").lazyload();
					}
				  });
				 
				});
			</script>
			<div style="padding:15px 0">
				<a href="/san-pham" class="btn btn-default">XEM THÊM</a>
				<div class="pull-right">
					<span class="ico-prev cursor" onclick="$('.owl-carousel').data('owlCarousel').prev()"></span>
					<span class="ico-next cursor" onclick="$('.owl-carousel').data('owlCarousel').next()"></span>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div class="col-sm-4">
			<div class="cake-news">
				<h3><?php echo $news_info->Title?></h3>
				<div class="cake-text">
					<?php echo $news_info->Desc?>
				</div>
				<div class="small-content">
					<?php echo $news_info->Content?>	
				</div>
				<div style="padding:15px 0">
					<a href="/tin-tuc/<?php echo $news_info->Id?>-<?php echo $news_info->Alias?>" class="btn btn-default">XEM THÊM</a>
				</div>
			</div>
		</div>
	</div>
</div>
<?php
include APPPATH."views/frontend/inc/03_foot.php";
?>